
#ifndef CLENT_H
#define CLENT_H

#include<iostream>
#include<cstring>
#include <sys/types.h>
#include <sys/socket.h>
#include <stdio.h>
#include <netinet/in.h>
#include <arpa/inet.h>
#include <unistd.h>
#include <stdlib.h>
#include <fcntl.h>
#include <sys/shm.h>
#include <thread>

const int BUF_SIZE = 100;
class clent{
    private:
        unsigned short port;//端口号
    static int sock;
        unsigned long ip;
    static std::string name;
    public:
        clent(unsigned short p,std::string i="127.0.0.1");
        void start();
        ~clent(){close(sock);};
        void error(std::string m){std::cerr<<m<<" "<<errno<<std::endl;exit(-1);}
        void send_msg();
        void recv_msg();
};

int clent::sock=-1;
std::string clent::name="host";
#endif